<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>购物车，第一步</title>	
	<link rel="stylesheet" href="__TPL__/css/head.css"  type="text/css" />
	<script type="text/javascript" src='__TPL__/js/jquery-1.11.0.min.js'></script>
	<script type="text/javascript" src='__TPL__/js/head.js'></script>
	<script type="text/javascript" src='__TPL__/js/dingdan.js'></script>
	<link rel="stylesheet" href="__TPL__/css/dingdan.css" />
</head>
<body>
<!-- 最顶部的可关闭广告 -->
<!-- <div id='top_ad'><img src="__TPL__/images/top_ad.jpg" alt="" /></div> -->
<!-- 最顶部的可关闭广告结束-->
<!-- 头部灰色区域 -->
	<div id="top">
		<div class="top_main">
			<!-- 左侧 -->
			<div class="top_l fl">
				<p class="shoucang"><span class='fl'></span><a href="" class='fl'>收藏京东</a></p>
				<p class="didian"><span class='tu fl'></span><span class='wenzi fl'>北京</span></p>
			</div>
			<!-- 左侧结束 -->
			<!-- 右侧 -->
			<div class="top_r fr ">
				<ul>
					<li><span class='fl'>您好，欢迎来到京东！</span><a href="" class='fl'>[登录]</a> <a href="" class="denglu fl">[免费注册]</a> <span class='xian fl'>|</span></li>
					<li><a href="" class="dingdan fl">我的订单</a><span class='xian fl'>|</span></li>
					<li class='huiyuan'><a href="" class='fl'>会员俱乐部</a><span class='xian fl'>|</span></li>
					<li class="shouji">
						<div class="xia">
							<div class="xia_top">
								<div class="xia_top_l"></div>
								<div class="xia_top_r">
									<span>扫描我，即刻下载</span>
									<span class='hongse'>京东客户端</span>
								</div>
							</div>
							<div class="xia_foot">
								<span class='xia_foot1'></span><span class='xia_foot2'></span>
							</div>
						</div>
						<div class="topnei"><span></span></div>
						<p>
							<a href="" class="fl">手机京东</a><span class='daosan fl'></span><span class='xian fl'>|</span>
						</p>
						
					</li>
					<li class="li_kehu">
						<div class='xiabai'>
							<a href="">帮助中心</a>
							<a href="">售后服务</a>
							<a href="">在线客服</a>
							<a href="">投诉中心</a>
							<a href="">客服邮箱</a>
						</div>
						<div class="kehu">
							<a href="" class='fl'>客户服务</a><span class='daosan fl'></span><span class='xian fl'>|</span>
						</div>
						
					</li>
					<li class="li_kong">
						<div class="kong_wang">
							
						</div>
						<div class="wang">
							<a href="" class='fl'>网站导航</a><span class='daosan fl'></span>
						</div>
						<div class="kong_wang_da">
							<div class="kong_l">
								<p>特色栏目</p>
								<a href="">校园之星</a>
								<a href="">视频购物</a>
								<a href="">京东社区</a>
								<a href="">在线读书</a>
								<a href="">装机大师</a>
								<a href="">京东卡</a>
								<a href="">家装城</a>
								<a href="">搭配购</a>
								<a href="">我喜欢</a>
							</div>
							<div class="kong_m">
								<p>企业服务</p>
								<a href="">企业客户</a>
								<a href="">办公直通车</a>
							</div>
							<div class="kong_r">
							<p>旗下网站</p>
							<a href="">迷你挑</a>
							<a href="">English Site</a>
							</div>
							
						</div>
					</li>
				</ul>
			</div>
			<!-- 右侧结束 -->
		</div>
		
	</div>
<!-- 头部灰色区域结束 -->
<!-- 中间主体区域 -->
	<div id="main">
		<div id="logo">
			<a href="" class="logo"><img src="__TPL__/images/logo.png" alt="" /></a>
			<div class="r">
				<span class='buzhou1'>1.我的购物车</span>
				<span class='buzhou2'>2.填写核对订单信息</span>
				<span class='buzhou3'>3.成功提交订单</span>
			</div>
		</div>
		<div id="mycar">
			<!-- <h2><span class='big'><span>我的购物车</span></span><span>现在</span><a class='denglu' href='#'>登录</a><span>， 您购物车中的商品将被永久保存</span></h2> -->
			<div class="xuanze">
				<div class="bg">
					<div class="all">
						<!-- <input type="checkbox" />全选 -->
					</div>
					<div class="product">
						商品
					</div>
					<div class="jingjia">
						京东价
					</div>
					<div class="youhui">
						优惠
					</div>
					<div class="dizhi">
						<select name="" id="">
							<option value="">北京</option>
						</select>
					</div>
					<div class="num">
						数量
					</div>
					<div class="caozuo">
						操作
					</div>
				</div>
			<list from="$goods" name="g">
				<div class="row">
					<div class="all">
						<!-- <input type="checkbox" /><a href="{$g._url}" target="_blank"> -->
						<img src="__ROOT__/{$g.index_pic}" alt="" width="50" height='50' /></a>
					</div>
					<div class="product">
						<a href="{$g._url}" target="_blank">{$g.gname}</a>
						<p style="padding:5px;color:#900;font-weight:700">{$g._attr}</p>
					</div>
					<div class="jingjia">
						¥{$g.price}
					</div>
					<div class="youhui">
						无
					</div>
					<div class="dizhi">
						有货
					</div>
					<div class="num">
						<?php
							$stid=$g['stid'];
							echo $_SESSION['cart']['goods'][$stid]['num']; 
						?>
					</div>
					<div class="caozuo">
						<a href="{|U:'del',array('stid'=>$g['stid'])}">删除</a>
						
					</div>
				</div>
			</list>
				<div class="dibu">
					<!-- <a href="" class="fl">删除选中的商品</a> -->
					<div class="jisuan">
						<p><span>{$hd.session.cart.total}件商品 总计:</span> ¥{$hd.session.cart.prices}.00</p>
					</div>
				</div>
				<div class="zong">
					总计（不含运费）：
					<span>¥{$hd.session.cart.prices}.00</span>
				</div>
			</div>
			<div class="go">
					<a href="__ROOT__" class="l">继续购物</a>
					<a href="javascript:" onclick="redirect();" class="r"></a>
			</div>
		</div>
<!-- 登陆注册隐藏 -->
<div id="UserHidden" class="dn">
	<div class="userMenu">
		<span class="fm f14 pl10 pr10 pt5 pb5 dib hand tsblack white bggray3">登陆</span>
		<span class="fm f14 pl10 pr10 pt5 pb5 dib hand tsblack white">注册</span>
	</div>
	<ul class="userSub">
		<li class="w400 auto bdc">
			<form action="{|U('User/login')}" method="post">
				<p class="p10 bgred white">用户登陆</p>
				<p class="p10 fix"><span class="w100 dib tr mr5">用户名：</span> <input type="text" name="username" class="p5 bde pct50" /></p>
				<p class="p10 fix"><span class="w100 dib tr mr5">密码：</span> <input type="password" name="password" class="p5 bde pct50" /></p>
				<p class="p10 tc fm"><input type="button" value="登陆" class="btn bgred pct30 f16" /></p>
			</form>
		</li>
		<li class="w400 auto bdc dn">
			<form action="{|U('User/reg')}" method="post">
				<p class="p10 bggreen white">用户注册</p>
				<p class="p10 fix"><span class="w100 dib tr mr5">用户名：</span> <input type="text" name="username" class="p5 bde pct50" /></p>
				<p class="p10 fix"><span class="w100 dib tr mr5">密码：</span> <input type="password" name="password" class="p5 bde pct50" /></p>
				<p class="p10 tc fm"><input type="button" value="注册" class="btn bggreen pct30 f16" /></p>
			</form>
		</li>
	</ul>
</div>
<!-- 登陆注册隐藏结束 -->
<script type="text/javascript">
	//登陆注册表单
	function redirect(){
		//判断用户是否已经登陆，决定是否显示登陆注册
		var uid="{$hd.session.uid.uid}";
		if(!uid){
			var UserHidden = $('#UserHidden').html();
				$('#UserHidden').remove();
			//显示登陆注册对话框
			$.msg({
				str:UserHidden, //默认内容
			 	timeout:500, //关闭时间
			 	shade:1, //是否有遮罩
			 	closebtn:1, //是否显示关闭按钮
			 	close:function(){
			 		var h="<div id='UserHidden' class='dn'>"+UserHidden+"</div>";
			 		$('body').append(h);
			 	} //回调函数
			});
			//tabqiehuan
			$('.userMenu span').mouseover(function(){
				$('.userSub li').eq($(this).index()).show().siblings().hide();
				$(this).addClass('bggray3').siblings().removeClass('bggray3');
			})
			//ajax发送注册，登陆数据
			$('input:button').click(function(){
				var redUrl = "{|U('dingdan')}";
				var url=$(this).parent().parent().attr('action');
				var uname=$(this).parent().parent().find('input[name=username]').val();
				var pwd=$(this).parent().parent().find('input[name=password]').val();
				$.post(url,{username:uname,pwd:pwd},function(re){
					if(re==0){
						alert('用户名或密码不正确');
					}else{
						location.href=redUrl;
					}
				})
			})
		}else{
			var redUrl = "{|U('dingdan')}";
			location.href=redUrl;
		}
	}
	
</script>



<include file="__TPL__/foot.html">